home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Programming / AMOSList / AMOSLIST.0897 / 000192_amos-request@svcs1.digex.net_Mon Aug 11 08:02:40 1997.msg < prev    next >
Text File  |  1997-09-09  |  3KB  |  81 lines

  1. Received: from svcs1.digex.net (svcs1.digex.net [204.91.197.224])
  2.     by mail1.access.digex.net (8.8.5/8.8.5) with ESMTP id IAA24326
  3.     for <mcox@access.digex.net>; Mon, 11 Aug 1997 08:02:38 -0400 (EDT)
  4. Received: (from daemon@localhost)
  5.     by svcs1.digex.net (8.8.5/8.8.5) id GAA29646
  6.     for amos-out; Mon, 11 Aug 1997 06:43:04 -0400 (EDT)
  7. Received: from mail1.access.digex.net (mail1.access.digex.net [205.197.247.2])
  8.     by svcs1.digex.net (8.8.5/8.8.5) with ESMTP id GAA29643
  9.     for <amos-list@svcs1.digex.net>; Mon, 11 Aug 1997 06:43:03 -0400 (EDT)
  10. Received: from cu.cu-muc.de ([195.38.157.2])
  11.     by mail1.access.digex.net (8.8.5/8.8.5) with SMTP id GAA19104
  12.     for <amos-list@access.digex.net>; Mon, 11 Aug 1997 06:42:52 -0400 (EDT)
  13. X-ROUTED: Mon, 11 Aug 1997 12:44:46 -0500
  14. X-TCP-IDENTITY: Platon
  15. Received: from cu-muc.de [195.38.157.108] by cu.cu-muc.de with smtp
  16.     id AMCIAIFM ; Mon, 11 Aug 1997 12:40:08 -0500
  17. From: Chris Hodges <platon@cu-muc.de>
  18. To: amos-list@access.digex.net
  19. Date: Mon, 11 Aug 1997 12:38:28 EST5
  20. Message-ID: <yam7162.1413.136958392@cu.cu-muc.de>
  21. In-Reply-To: <tcppop3.511242@cu.cu-muc.de>
  22. X-Mailer: YAM 1.3.4 [040] - Amiga Mailer by Marcel Beck
  23. Subject: Re: To Chris Hodges
  24. MIME-Version: 1.0
  25. Content-Type: text/plain; charset=iso-8859-1
  26. Content-Transfer-Encoding: 8bit
  27. X-MIME-Autoconverted: from quoted-printable to 8bit by svcs1.digex.net id GAA29644
  28. Status: O
  29. X-Status: 
  30.  
  31. malcolm.murray@virgin.net wrote on 10-Aug-97:
  32.  
  33. > Sorry. I've just realised that Qrnd(0) or Rnd(0) returns the last value from a Rnd statement.
  34.  
  35. :)
  36.  
  37. > Randomize 10 (or whatever)
  38. > For N=1 to 3
  39. > Print Rnd(-100)  (note the -ve number)
  40. > Next N
  41.  
  42. > This program will ALWAYS return the same three numbers.
  43.  
  44. Yup.
  45.  
  46. > It doesn't work with Qrnd though.
  47. > Is there any way of achieving a similar result with Qrnd?
  48.  
  49. Nope, unfortunately not, as Qrnd generates  it's  random  numbers  via  the
  50. raster  beam  position  and not using a complicated mathematic formular. So
  51. the random numbers cannot be  reproduced  and  therefore  are  real  random
  52. numbers :)
  53.  
  54. And now some a hint for generating a random numbers array with (nearly) the
  55. same amount of each number:
  56.  
  57. Reserve as Work 9,AMOUNT*2
  58. ST=Start(9)
  59. ' Create an array with all numbers we want to have.
  60. For A=0 To AMOUNT-1
  61.   Doke ST+A*2,A Mod MAXRND
  62. Next
  63. ' Now shuffle this array
  64. For A=0 To AMOUNT-1
  65.   RI=Qrnd(AMOUNT)
  66.   R=Deek(ST+RI*2)
  67.   Doke ST+RI*2,Deek(ST+A*2)
  68.   Doke ST+A*2,R
  69. Next
  70.  
  71. I used this kind of random number generator in my game Tubes.
  72.  
  73. -- 
  74. Bye,�Chris�Hodges (http://home.pages.de/~platon/)  ï¿½__����__
  75. A4000/60, 24MB, 3.6GB HD, CD-ROM, CV64, FliFix�__��///���/�/�_____
  76. GCS�d�H�s-:++�!g�p?�!au�a20�w++�v?�C+++����   ï¿½\\\///���/�/_/�___/�LOGOUT
  77. E----�N++�K-�W------�-po+�t++@�!5�j--�R+�G?�   ï¿½\XX/����\__/�__/��FASCISM!
  78. tv-�b+�D--�B?�e+(++)*�u++�h!�f�!r�n+�!y+�   AMIGA�RULEZ!� ï¿½\/
  79.  
  80.  
  81.